import axios from '../../axios.js';

const productApi= {
    //获取产品数据
    showproducts:function (params) {
        //发请求
        return axios({
            url:"/products/showproducts",
            method:"get",
            params
        })
    },
     //删除单个
     delectone:function (data) {
        return axios({
            url:"/products",
            method:"delete",
            data,
        })
    },
     //新增种类
     addproduct:function (data) {
        return axios({
            url:"/products",
            method:"post",
            data
        })
    },
     //获取要修改的匹配的数据
     getproductid:function (params) {
        return axios ({
            url: "/products/"+params,
            method: "get",
        })
    },
      //确认修改信息
      updateproduct:function (data) {
        return axios ({
            url: "/products",
            method: "put",
            data
        })
    }

}


export default productApi;